 <form class="basic" action="" method="POST">
    <img src="/resource/www/imgs/lux_1.png" class="jind-img">

    <div class="city fix">
      <span class="text">城市</span>
      <div class="city-box">
          <span class="cityname"><{$track.city}></span>
      </div>
        <input type=hidden name='cityId' value='<{$track.cityId}>'>
        <input type=hidden name='city' value='<{$track.city}>'>
        <input type=hidden name='country' value='<{$track.country}>'>
    </div>
    <div class="chux fix">
        <span class="text">
            出行方式
            <br>
            (多选)
        </span>
        <label class="label">
            <input class="input chuxfs" type="checkbox" name="trafficSupportCar" value="1" id="" <{if $track.trafficSupportCar}>checked="checked"<{/if}>>私家车
        </label>
        <label class="label">
            <input class="input chuxfs" type="checkbox" name="trafficSupportBus" value="1" id="" <{if $track.trafficSupportBus}>checked="checked"<{/if}>>公共交通
        </label>
    </div>

    <div class="renq fix">
        <span class="text">
            适宜人群
            <br>
            (多选)
        </span>
        <label class="label">
            <input class="input" type="checkbox" value="1" name="support70s" id="" <{if $track.support70s}>checked="checked"<{/if}>>70后
        </label>
        <label class="label">
            <input class="input" type="checkbox" value="1" name="support80s" id="" <{if $track.support80s}>checked="checked"<{/if}>>80后
        </label>
        <label class="label">
            <input class="input" type="checkbox" value="1" name="support90s" id="" <{if $track.support90s}>checked="checked"<{/if}>>90后
        </label>
        <label class="label">
            <input class="input" type="checkbox" value="1" name="support00s" id="" <{if $track.support00s}>checked="checked"<{/if}>>00后
        </label>
    </div>

     <{$smarty.section.loop.index = $smarty.section.loop.index + 1}>
    <div class="jied fix">
        <span class="text">
            可接待人数
        </span>
        <select name="serviceMinPersons" class="select">
            <option  value="-1" >最低不少于1人</option>
            <{section name=loop loop=15}>
            <option  value="<{$smarty.section.loop.index+1}>" <{if $track.serviceMinPersons == ($smarty.section.loop.index+1)}>selected<{/if}>><{$smarty.section.loop.index+1}>人</option>
            <{/section}>
        </select>
        <span class="number">人</span>
        <select name="serviceMaxPersons" class="select">
            <option  value="-1" >最高不多于15人</option>
            <{section name=loop loop=15}>
            <option  value="<{$smarty.section.loop.index+1}>" <{if $track.serviceMaxPersons == ($smarty.section.loop.index+1)}>selected<{/if}>><{$smarty.section.loop.index+1}>人</option>
            <{/section}>
        </select>
        <span class="number">人</span>
    </div>

    <div class="tians fix">
        <span class="text">行程天数</span>
        <select name="days" class="select">
            <option  value="-1">请选择天数</option>
            <{section name=loop loop=15}>
            <option  value="<{$smarty.section.loop.index+1}>" <{if $track.days == ($smarty.section.loop.index+1)}>selected<{/if}>><{$smarty.section.loop.index+1}>天</option>
            <{/section}>
        </select>
    </div>

    <input type="submit" class="submit" name="submit1" value="下一步" onclick="return submit_track_basic();">
    
    <div class='city-wrap' style="display:none;">
        <ul class="country-box">
           <{foreach from=$cityList item=citys name=countryBox key=country}>
             <{if $smarty.foreach.countryBox.index==0}>     
             <li country="<{$country}>" class="active"><{$country}></li>
             <{else}>
             <li country="<{$country}>"><{$country}></li>
             <{/if}>
           <{/foreach}>
        </ul>

        <{foreach from=$cityList item=citys name=cityBox key=country}>
           <div class='city-item' country='<{$country}>' 
           <{if $smarty.foreach.cityBox.index==0}>
           <{else}>     
           style="display:none;"
           <{/if}>
           >
           <{foreach from=$citys item=city key=cityId}>
            <a href='javascript:void(0);' data='<{$cityId}>'><{$city}></a>
           <{/foreach}>
           </div>
        <{/foreach}>

    </div>
</form>

<script>

$(".city-box .cityname").click(function(e){
    e.stopPropagation();
    $('.city-wrap').toggle();
});
$(".city-wrap .country-box li").click(function(e){
    e.stopPropagation();
    $('.country-box li').removeClass('active'); 
    $(this).addClass('active');
    $('.city-item').hide();
    var country=$(this).attr('country');
    $('.city-item[country='+country+']').show();
});
$('.city-wrap .city-item a').click(function(e){
	var id=$(this).attr('data');
	var city=$(this).html();
        var country=$(this).parent().attr('country');
	$("input[name='cityId']").val(id);
	$("input[name='city']").val(city);
	$("input[name='country']").val(country);
	$('.city-wrap').hide();
	$('.city-box .cityname').html(city);
});
$(document).click(function() {
    $('.city-wrap').hide();
});

function submit_track_basic() {

    var oCountry = $('.basic').find("input[name='country']").val();
    if (oCountry == '') {
        layer.msg('请选择国家');
        return false;
    }

    var oCity = $('.basic').find("input[name='city']").val();
    var oCityId = $('.basic').find("input[name='cityId']").val();
    if (oCity == ''||oCityId =='') {
        layer.msg('请选择城市');
        return false;
    }

    if (!$("input:checkbox[name*='trafficSupport']").is(':checked')) {
        layer.msg('请选择出行方式');
        return false;
    }

    if (!$("input:checkbox[name*='support']").is(':checked')) {
        layer.msg('请选择适宜人群');
        return false;
    }

    var oMixpeople = $('.basic').find("select[name='serviceMinPersons']").val();
    if (oMixpeople == -1) {
        layer.msg('请选择最小可接待人数');
        return false;
    }

    var oMaxpeople = $('.basic').find("select[name='serviceMaxPersons']").val();
    if (oMaxpeople == -1) {
        layer.msg('请选择最大可接待人数');
        return false;
    }

    var oDays = $('.basic').find("select[name='days']").val();
    if (oDays == -1) {
        layer.msg('请选择行程天数');
        return false;
    }


}

</script>
